package com.young.springdemo.service.commandchain;

import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

@Service
public class TestQingjia {


//    @PostConstruct
    public void testQingjia(){
        ZhuRen zhuRen = new ZhuRen("張主任");
        JingLi jingLi = new JingLi("李經理");
        ZongJingLi zongJingLi = new ZongJingLi("總經理");

        QingjiaDetail xiaowang = new QingjiaDetail("小王","請假回家",2);
        QingjiaDetail xiaozhang = new QingjiaDetail("小張","結婚",5);
        QingjiaDetail xiaoli = new QingjiaDetail("小李","請假回家",14);
        QingjiaDetail xiaohong = new QingjiaDetail("小紅","請假回家",45);

        //設置責任鏈
        zhuRen.setRequest(jingLi);
        jingLi.setRequest(zongJingLi);

        zhuRen.requestQingjia(xiaowang);
        zhuRen.requestQingjia(xiaozhang);
        zhuRen.requestQingjia(xiaoli);
        zhuRen.requestQingjia(xiaohong);

    }

}
